//部门信息连接
const collegeInfo = require('../mongo/collegeInfo')
var connect = {
	// 
	find: function (data,callback){
		collegeInfo.find(data,function(err,datas){
			
			callback(datas)
		})
	},
	//
	add: function(data,callback){
		new collegeInfo(data).save(function(err,datas){
			if(!err) callback(1)
		})
	},
	// 修改
	update: function (factor, data, callback) {
		// console.log(data)
		collegeInfo.updateOne(factor, data, function (err, res) {
			if (!err) return callback(res)
			// callback(0)
			// console.log(err)
			// console.log(res)
		})
	},
	// 删除
	delete: function (data, callback) {
		collegeInfo.deleteOne(data, function (err, data) {
			if (!err) return callback(1)
		})
	}
}
module.exports = connect
